#ifndef OPENCL_H
#define OPENCL_H

#include "../../lib/droplet.h"


__kernel void move_droplet(
	double const time_delta,
	float const screen_height,
	float const friction,
	__global Droplet * droplets,
	uint droplet_count);


__kernel void merge_overlapping_droplets(
	__global Droplet * droplets,
	uint const droplet_count,
	__global int * droplets_to_erase);


void start_of_merge_overlapping_droplets(
	uint const droplet_count, uint const total_iters, uint ** i, uint ** j);


/*
Converts a cell number into coordinates, where the grid is of equal height
and width and every row has a width 1 less than the row below it, forming a
right angled triangle.

Example of a grid with width == 3:
2|       5
1|    3  4
0| 0  1  2
  --------
   0  1  2
*/
void cell_number_to_coordinate(
	uint const cell_number, uint const width, uint ** x, uint ** y);


uint get_items_per_work_item(uint const item_count);

#endif
